package com.nxn.core.service;

import java.util.ResourceBundle;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;

@ContextConfiguration(locations = {
        "classpath:/common/applicationContext-resources.xml",
        "classpath:/common/applicationContext-dao.xml",
        "classpath:/common/applicationContext-service.xml",
        "classpath*:**/applicationContext.xml"})
/**
 * Test classes can extend this manager based on a spring context.
 * This test class can be moved to the test tree.
 *
 * @author Michael
 */
public abstract class BaseServiceTestCase extends AbstractTransactionalJUnit4SpringContextTests {

    /**
     * A simple logger
     */
    protected final Log log = LogFactory.getLog(getClass());
    /**
     * The resourceBundle
     */
    protected ResourceBundle rb;

    /**
     * Default constructor will set the ResourceBundle if needed.
     */
    public BaseServiceTestCase() {
        // Since a ResourceBundle is not required for each class, just
        // do a simple check to see if one exists
        String className = this.getClass().getName();

//        try {
//            rb = ResourceBundle.getBundle(className);
//        } catch (MissingResourceException mre) {
//             log.warn("No resource bundle found for: " + className);
//        }
    }

}
